﻿@inherits TabSetBase

<nav>
    <div class="d-flex">
        <div class="nav-link-bar" @onclick="MovePrev"><i class="fa fa-chevron-left"></i></div>
        <div id="navBar" class="nav nav-tabs flex-fill flex-nowrap overflow-hidden" role="tablist">
            @foreach (var tab in Tabs)
            {
                <Tab @key="@tab.Id" Active="@tab.Active" Id="@tab.Id" Icon="@tab.Icon" Url="@tab.Url.ToBlazorMenuUrl()" Title="@tab.Title"></Tab>
            }
        </div>
        <div class="nav-link-bar" @onclick="MoveNext"><i class="fa fa-chevron-right"></i></div>
        <div class="dropdown nav-link-bar">
            <div class="nav-link-close dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><i class="fa fa-chevron-down"></i></div>
            <div class="dropdown-menu dropdown-menu-right" aria-labelledby="关闭标签下拉菜单">
                <div class="dropdown-item" @onclick="CloseCurrentTab"><span>关闭当前标签</span></div>
                <div class="dropdown-item" @onclick="CloseOtherTab"><span>关闭其他标签</span></div>
                <div class="dropdown-item" @onclick="CloseAllTab"><span>关闭所有标签</span></div>
            </div>
        </div>
    </div>
</nav>
<div class="tab-content">
    @foreach (var comp in Pages)
    {
        <div id="@string.Format("page_{0}", comp.Id)" class="tab-pane @(comp.Active ? "fade active show" : "fade")" role="tabpanel" aria-labelledby="nav-profile-tab">
            <PageContent @key="comp" Name="@comp.Name"></PageContent>
        </div>
    }
</div>
